﻿ using GameStoreMinimalApi.WebApi.Dtos;

namespace GameStoreMinimalApi.WebApi.Entities;

public static class EntityExtensions
{
    public static GameResponseV1 AsGameResponseV1(this Game game)
    {
        return new GameResponseV1(
            game.Id,
            game.Name,
            game.Genre,
            game.Price,
            game.ReleaseDate,
            game.ImageUri
        );
    }

    public static GameResponseV2 AsGameResponseV2(this Game game)
    {
        return new GameResponseV2(
            game.Id,
            game.Name,
            game.Genre,
            game.Price * 0.7m,
            game.Price,
            game.ReleaseDate,
            game.ImageUri
        );
    }
}
